<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//path
require(CONFIG_PATH . CONFIG_DIR_LIB . 'Smarty-2.6.14/libs/Smarty.class.php');

//
define('TPL_CURRENT', CONFIG_PATH . CONFIG_DIR_TEMPLATES . CONFIG_THEME .'/');
define('TPL_CURRENT_C', CONFIG_PATH . CONFIG_DIR_CACHE . 'tpl/' . CONFIG_THEME . '/');
define('TPL_CURRENT_CONFIG', CONFIG_PATH . CONFIG_DIR_SETTINGS . 'tpl/' . CONFIG_THEME . '/');
define('TPL_CACHE', CONFIG_DIR_CACHE);

//
if( !is_dir(TPL_CURRENT_C) || !file_exists(TPL_CURRENT_C) ) {
 	if( !@mkdir(TPL_CURRENT_C) ) {
		die("Cannot create directory: " . TPL_CURRENT_C);
	}
}

// Template Class
class Template extends Smarty {
 	function Template() {
        $this->template_dir = TPL_CURRENT;
        $this->compile_dir = TPL_CURRENT_C;
        $this->config_dir = TPL_CURRENT_CONFIG;
        $this->cache_dir = TPL_CACHE;
    }
}
//
?>